﻿using System.Configuration;
using System.Diagnostics;

namespace JSC.Portal.Web.Handlers.Asset
{
    /// <summary>
    /// Original code copied from KiGG
    /// </summary>
    public class AssetElementCollection : ConfigurationElementCollection
    {
        public new AssetElement this[string name]
        {
            [DebuggerStepThrough]
            get
            {
                return BaseGet(name) as AssetElement;
            }
        }

        public void Add(AssetElement element)
        {
            BaseAdd(element);
        }

        protected override ConfigurationElement CreateNewElement()
        {
            return new AssetElement();
        }

        protected override object GetElementKey(ConfigurationElement element)
        {
            return ((AssetElement)element).Name;
        }
    }
}
